//
//  HNGetKnowledgePapersCell.m
//  XDEducation
//
//  Created by 星道 on 17/5/19.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "HNGetKnowledgePapersCell.h"

@implementation HNGetKnowledgePapersCell
{
    IBOutlet UILabel *_Title;
}

- (void)setModel:(HNGetKnowledgePapersModel *)Model
{
    _Model = Model;
    
    _Title.text = Model.paperName;
}

- (IBAction)ClickDownLoad:(UIButton *)sender
{
    [MBProgressHUD showHUD];
    NSString *UrlStr = [NSString stringWithFormat:@"consolidate.do?action=downloadPaper2&uid=%@&ptype=3&paperid=%@",[AccountTool shareAccountTool].currentAccount.uid,[self.Model.Paper_ID stringValue]];
    [XDHttpTool get:BaseURL(UrlStr) authCode:[AccountTool shareAccountTool].currentAccount.authCode params:nil success:^(id responseObj) {
       if ([responseObj[@"code"] isEqualToNumber:@1000])
       {
           if (self.DownloadSuccess)
           {
               self.DownloadSuccess ();
           }
       }
       else
        {
            [MBProgressHUD showError:responseObj[@"msg"]];
        }
    } failure:^(NSError *error) {
        [MBProgressHUD showError:XDNetWorkError];
    }];
}
@end
